import axios from 'axios'

const api = axios.create({
  baseURL: 'http://localhost:3000',
})

export const getTodos = () => api.get('/todos')

export const getStatusconfig = () => api.get('/statusconfig')

export const getCategories = () => api.get('/categories')
export const addTodo = (todo) => api.post('/todos', todo)

export const deleteTodo = (id) => api.delete(`/todos/${id}`)

export const updateTodoSortNum = (id, sortNum) => api.put(`/todos/${id}`, { sortNum })

export default api
